<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
	request.setCharacterEncoding("utf-8");
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";

	String ___uploadPrefix = "mail";//objectType,默认使用"".
	request.getSession().setAttribute("___uploadPrefix",
			___uploadPrefix);
	//String attachScript =UploadService.getInstance().getAttchmentScripts(___uploadPrefix,"112233");
%>


<%
	double perMaxSize = 3;//单个文件允许的max大小
	String sizeUnit = "MB";//perMaxSize数据对应的单位
	String ext = "*.jpg;*.jpeg;*.gif";//允许上传的文件类型
	//文件上传提交的目标页面
	StringBuffer uploadUrl = new StringBuffer("http://");
	uploadUrl.append(request.getHeader("Host"));
	uploadUrl.append(request.getContextPath());
	uploadUrl.append("/page/upload/UploadFileSubmit.jsp");
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>添加用户</title>
<link rel="stylesheet" href="../../easyui/themes/default/easyui.css"
	type="text/css" media="screen" />
<link rel="stylesheet" href="../../easyui/themes/icon.css"
	type="text/css" media="screen" />
<link rel="stylesheet" href="../../css/main.css" type="text/css"
	media="screen" />
<link rel="stylesheet" type="text/css" href="../../css/Tooltip.css" />
<link rel="stylesheet" type="text/css" href="css/userManager.css" />
<script src="../../easyui/jquery-1.4.4.min.js"></script>
<script src="../../easyui/jquery.easyui.min.js"></script>
<!-- mytab -->
<script src="../../myjs/myTab.js"></script>
<!-- sys -->
<script src="../../myjs/sys.js"></script>
<script src="../../myjs/DatePicker/WdatePicker.js"></script>
<!-- upload -->
<link rel="stylesheet" href="../../css/uploadhead.css"
	type="text/css" media="screen" />
<script type="text/javascript" src="../../page/upload/js/swfupload.js"></script>
<script type="text/javascript" src="../../page/upload/js/swfupload.swfobject.js"></script>
<script type="text/javascript" src="../../page/upload/js/swfupload.queue.js"></script>
<script type="text/javascript" src="../../page/upload/js/fileprogress.js"></script>
<script type="text/javascript" src="../../page/upload/js/handlers.js"></script>
</head>
<body>
<script>
$(function(){
	win = $('#user-window').window({
		closed:true
	});
	form = win.find('form');
	
});
var swfu;

SWFUpload.onload = function () {
	var settings = {
		flash_url : "../../page/upload/js/swfupload.swf",
		upload_url: "<%=uploadUrl.toString()%>",
		post_params: {
			"user_id" : "stephen830",
			"pass_id" : "123456"
		},
		file_size_limit : "<%=perMaxSize%> <%=sizeUnit%>",
		file_types : "<%=ext%>",
		file_types_description : "<%=ext%>",
		file_upload_limit : 1,
		file_queue_limit : 0,
		custom_settings : {
			progressTarget : "fsUploadProgress",
			cancelButtonId : "btnCancel",
			uploadButtonId : "btnUpload",
			myFileListTarget : "idFileList"
		},
		debug: false,
		auto_upload:false,

		// Button Settings
		button_image_url : "../../page/upload/images/XPButtonUploadText_61x22.png",	// Relative to the SWF file
		button_placeholder_id : "spanButtonPlaceholder",
		button_width: 61,
		button_height: 22,

		// The event handler functions are defined in handlers.js
		swfupload_loaded_handler : swfUploadLoaded,
		file_queued_handler : fileQueued,
		file_queue_error_handler : fileQueueError,
		file_dialog_complete_handler : fileDialogComplete,
		upload_start_handler : uploadStart,
		upload_progress_handler : uploadProgress,
		upload_error_handler : uploadError,
		upload_success_handler : uploadSuccess,
		upload_complete_handler : uploadComplete,
		queue_complete_handler : queueComplete,	// Queue plugin event
		
		// SWFObject settings
		minimum_flash_version : "9.0.28",
		swfupload_pre_load_handler : swfUploadPreLoad,
		swfupload_load_failed_handler : swfUploadLoadFailed
	};

	swfu = new SWFUpload(settings);
	
}

function uploadHeadImg() {
	win.window('open');
	//form.form('clear');
	alert(file.name);
	

	
}
</script>
<div id="page">
<div class="clear"></div>
<div class="blue_box">
<div class="blue_box_title">
<h2><img src="images/blue_box_title.gif" title="新用户注册" alt="新用户注册" /></h2>
<p>为了保证信息的高可用性，请认真填写员工的资料！</p>
</div>
<div class="content">
<form name="regform" id="regform" method="post">
<table>
	<tr>
		<td>
		<div><b>员工姓名：</b> <input type="text" size="32" name="real_name"
			id="real_name" value="" maxlength="20" class="easyui-validatebox"
			required="true"
			style="width: 198px; padding: 3px 5px; border: solid 1px #B8BFE9;">
		</div>
		<div><b>性别：</b> <input class="easyui-combobox" name="sex"
			url="sex.json" valueField="id" textField="text" multiple="false"
			panelHeight="auto" required="false"></input></div>
		<div><b>生日：</b> <input type="text" class="Wdate" size="32"
			name="birthday" id="birthday" value="" maxlength="10"
			onClick=WdatePicker();></div>
		<div><b>联系方式：</b> <input type="text" size="32" name="mobil_no"
			id="mobil_no" value="" maxlength="20" class="easyui-validatebox"
			required="true"
			style="width: 198px; padding: 3px 5px; border: solid 1px #B8BFE9;">
		</div>
		<div><b>Email：</b> <input type="text" size="32" name="email"
	id="email" value="" maxlength="100" class="easyui-validatebox"
	required="true" validType="email"
	style="width: 198px; padding: 3px 5px; border: solid 1px #B8BFE9;">
</div>
		</td>
		<td>
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		</td>
		<td>
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		</td>
		<td>
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		</td>
		<td>
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		</td>
		<td>
		<div
			style="text-align: center; border: 1px solid #ccc;  width: 150px; background: #fafafa; padding-top: 10px;">
		<img src="image/"+file.name ondblclick="uploadHeadImg();"></img> <input type="hidden" size="32"
			name="photo" id="photo" value="images/msn.gif"/>
			<p style="color:#3D6A93; font-size:13px;">双击上传新照片！</p>
		</div>
		</td>
	</tr>
</table>
<div><b>QQ：</b> <input type="text" size="32" name="qq_no"
	id="qq_no" value="" maxlength="20" class="easyui-validatebox"
	required="false"
	style="width: 198px; padding: 3px 5px; border: solid 1px #B8BFE9;">
</div>
<div><b>MSN：</b> <input type="text" size="32" name="msn_no"
	id="msn_no" value="" maxlength="50" class="easyui-validatebox"
	required="false"
	style="width: 198px; padding: 3px 5px; border: solid 1px #B8BFE9;">
</div>
<div><b>学历：</b> <input class="easyui-combobox" name="diploma"
	url="/pxglxt/dic_educationbackground/getDicsForComb"
	valueField="dickey" textField="dicvalue" multiple="false"
	panelHeight="auto" required="true"></input></div>
<div><b>专业：</b> <input type="text" size="32" name="major"
	id="major" value="" maxlength="100" class="easyui-validatebox"
	required="false"
	style="width: 198px; padding: 3px 5px; border: solid 1px #B8BFE9;">
</div>
<div><b>毕业(就读)学校：</b> <input type="text" size="32"
	name="finishschool" id="finishschool" value="" maxlength="100"
	class="easyui-validatebox" required="false"
	style="width: 198px; padding: 3px 5px; border: solid 1px #B8BFE9;">
</div>
<div><b>简历：</b> <input type="textArea" size="32" name="resume"
	id="resume" value="" maxlength="1000" class="easyui-validatebox"
	required="false"
	style="width: 198px; padding: 3px 5px; border: solid 1px #B8BFE9;">
</div>
<div><b>家庭电话：</b> <input type="text" size="32" name="tel_no_home"
	id="tel_no_home" value="" maxlength="20" class="easyui-validatebox"
	required="false"
	style="width: 198px; padding: 3px 5px; border: solid 1px #B8BFE9;">
</div>
<div><b>家庭住址：</b> <input type="text" size="32" name="home_add"
	id="home_add" value="" maxlength="100" class="easyui-validatebox"
	required="false"
	style="width: 198px; padding: 3px 5px; border: solid 1px #B8BFE9;">
</div>
<div><b>邮编：</b> <input type="text" size="32" name="post_no_home"
	id="post_no_home" value="" maxlength="20" class="easyui-validatebox"
	required="false"
	style="width: 198px; padding: 3px 5px; border: solid 1px #B8BFE9;">
</div>
<div><b>任聘日期：</b> <input type="text" class="Wdate" size="32"
	name="come_date" id="come_date" value="" maxlength="10"
	onClick=WdatePicker();></div>
<div><b>离职日期：</b> <input type="text" class="Wdate" size="32"
	name="out_date" id="out_date" value="" maxlength="10"
	onClick=WdatePicker();></div>
<div><b>IC卡号：</b> <input type="text" size="32" name="ic_no"
	id="ic_no" value="" maxlength="100" class="easyui-validatebox"
	required="false"
	style="width: 198px; padding: 3px 5px; border: solid 1px #B8BFE9;">
</div>
<div><b>试用期：</b> <input class="easyui-combobox"
	name="is_probation" url="/pxglxt/dic_labourtype/getDicsForComb"
	valueField="dickey" textField="dicvalue" multiple="false"
	panelHeight="auto" required="true"></input></div>
<div><b>部门：</b> <input class="easyui-combobox" name=""
	dept_id""
		url="/pxglxt/department/getDepartmentsForComb"
	valueField="dept_no" textField="dept_name" multiple="false"
	panelHeight="auto" required="false"></input></div>
<div><b>部门个人电话：</b> <input type="text" size="32"
	name="tel_no_dept" id="tel_no_dept" value="" maxlength="20"
	class="easyui-validatebox" required="false"
	style="width: 198px; padding: 3px 5px; border: solid 1px #B8BFE9;">
</div>
<div><b>备注：</b> <textarea name="remark" id="remark"
	class="easyui-validatebox" required="false"
	style="height: 100px; width: 198px; padding: 3px 5px; border: solid 1px #B8BFE9;"></textarea>
</div>
<div><b>是否启用：</b> <input class="easyui-combobox" name="disabled"
	url="disabled.json" valueField="id" textField="text" multiple="false"
	panelHeight="auto" required="true"></input></div>
<div class="btn"><input type="submit" id="UpdButton1"
	name="UpdButton1" value="确 定" /></div>
</form>
</div>
<div class="blue_box_down"></div>
</div>
<div class="clear"></div>
</div>
<!-- 上传头像 -->
<div id="user-window" title="部门管理窗口"
	style="width: 430px; height: 450px;">
<div style="padding: 10px 10px 10px 10px;">
<table width="100%" cellspacing="4" cellpadding="4" border="0"
	bgcolor="#FCFCFC">
	<tr>
		<td class="DH1"><!-- 头信息 -->
		<table width="100%" cellspacing="4" cellpadding="4" border="0"
			bgcolor="#FCFCFC">
			<tr>
				<td class="DH2"><STRONG>上传头像（支持的相片类型：<%=ext%>；单个相片最大不能超过：<%=perMaxSize%>
				<%=sizeUnit%>）</STRONG></td>
				<td class="DH2" align="right"></td>
			</tr>
		</table>

		<!-- 内容开始 -->
		<div id="content">
		<form id="form1" action="../../page/upload/UploadFileSubmit.jsp" method="post"
			enctype="multipart/form-data"><!-- 控制按钮 -->
		<table width="90%" cellspacing="0" cellpadding="0" border="0">
			<tr>
				<td><span id="spanButtonPlaceholder"></span> <input
					id="btnUpload" type="button" value="上传相片" class="btn" /> <input
					id="btnCancel" type="button" value="取消上传" disabled="disabled"
					class="btn" /></td>
			</tr>
		</table>

		<!-- 文件列表 -->
		<table id="idFileList" class="uploadFileList">
			<tr class="uploadTitle">
				<td width=20><B>&nbsp;</B></td>
				<td><B>文件名</B></td>
				<td><B>文件大小</B></td>
				<td width=100px><B>状态</B></td>
				<td width=35px>&nbsp;</td>
			</tr>
		</table>

		<!-- 文件上传的状态栏 --> 等待上传<span id="idFileListCount">0</span> 个 ， 成功上传<span
			id="idFileListSuccessUploadCount">0</span> 个
		<div id="divSWFUploadUI" style="visibility: hidden;"></div>
		<noscript
			style="display: block; margin: 10px 25px; padding: 10px 15px;">
		很抱歉，相片上传界面无法载入，请将浏览器设置成支持JavaScript。</noscript>
		<div id="divLoadingContent" class="content"
			style="background-color: #FFFF66; border-top: solid 4px #FF9966; border-bottom: solid 4px #FF9966; margin: 10px 25px; padding: 10px 15px; display: none;">
		相片上传界面正在载入，请稍后...</div>
		<div id="divLongLoading" class="content"
			style="background-color: #FFFF66; border-top: solid 4px #FF9966; border-bottom: solid 4px #FF9966; margin: 10px 25px; padding: 10px 15px; display: none;">
		相片上传界面载入失败，请确保浏览器已经开启对JavaScript的支持，并且已经安装可以工作的Flash插件版本。</div>
		<div id="divAlternateContent" class="content"
			style="background-color: #FFFF66; border-top: solid 4px #FF9966; border-bottom: solid 4px #FF9966; margin: 10px 25px; padding: 10px 15px; display: none;">
		很抱歉，相片上传界面无法载入，请安装或者升级您的Flash插件。 请访问： <a
			href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash"
			target="_blank">Adobe网站</a> 获取最新的Flash插件。</div>




		<!-- 已经删除的附件的逻辑名称（必须）,用逗号分割 --> <input type="hidden" id="deleteFiles"
			name="deleteFiles" value=""> <!--新增的附件的逻辑名称（必须）,用逗号分割 --> <input
			type="hidden" id="fileOids" name="fileOids" value=""> <!--objType -->
		<input type="hidden" id="objType" name="objType"
			value="<%=___uploadPrefix%>"> <!-- //附件存放位置：DB，数据库，FileDir ,文件目录 , DBAndFileDir , 两者都保存。 此处为冗余．-->
		<input type="hidden" id="UploadMode" name="UploadMode"
			value="DBAndFileDir"> <input type="hidden" id="uploadPrefix"
			name="uploadPrefix" value="<%=___uploadPrefix%>"></form>
		</div>
		</td>
	</tr>
</table>
</div>
</div>
</body>
</html>
